package progetto.android;

import java.io.IOException;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.OverlayItem;

import android.app.Activity;
import android.location.Geocoder;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class StartingActivity extends MapActivity {
	
	private MapView mapView;
	private MapController mapController;
	private LocationManager locationManager;
	private MyLocationOverlay myLocationOverlay;
	Geocoder gc;
	GeoPoint actualPosition;
	
	
    /** Called when the activity is first created. */
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout);
        
        locationManager=(LocationManager)getSystemService(LOCATION_SERVICE);//prende istanza LocationManager
        gc=new Geocoder(this);//nuova istanza Geocoder
        mapView=(MapView)findViewById(R.id.mapView);
        mapView.setBuiltInZoomControls(true);
        mapView.setSatellite(false);
        actualPosition=myLocationOverlay.getMyLocation();
        Log.d("Lat", String.valueOf(actualPosition.getLatitudeE6()));
        Log.d("Long", String.valueOf(actualPosition.getLongitudeE6()));
        
        //setto mapController
        mapController=mapView.getController();
        mapController.setCenter(actualPosition);
        mapController.setZoom(15);
        
        
    }

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
}